﻿<UserControl x:Class="EPE.WPF.UCShopsPriceSystemList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="700" d:DesignWidth="1024">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            
        </Grid.RowDefinitions>
        
        <Border Grid.Row="0" Height="500" Width="1000" Style="{StaticResource MainBorderStyle}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="140"></RowDefinition>
                    <RowDefinition Height="15"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>

                <GroupBox Grid.RowSpan="2" Header="查询条件" Height="130" Width="980" HorizontalAlignment="Center"  Margin="5,10,5,0" Name="groupBox1" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0">
                    <Grid Style="{StaticResource BorderGridStyle}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35"></RowDefinition>
                            <RowDefinition Height="10"></RowDefinition>
                            <RowDefinition Height="35"></RowDefinition>
                            <RowDefinition Height="10"></RowDefinition>
                            <RowDefinition Height="*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                            <ColumnDefinition Width="120"></ColumnDefinition>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                            <ColumnDefinition Width="120"></ColumnDefinition>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                            <ColumnDefinition Width="120"></ColumnDefinition>
                            <ColumnDefinition Width="400"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Label Content="参数名称"  Name="lblName"  Grid.Row="0" Grid.Column="0"   VerticalAlignment="Center" Style="{StaticResource LabelStyle}" />
                        <TextBox Name="txtName" Grid.Row="0" Grid.Column="1"  VerticalAlignment="Center" Style="{StaticResource TextBoxStyle}" />
                       

                        <StackPanel  Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="7" Orientation="Horizontal" >
                            <Button  Name="btnSearch" Click="btnSearch_Click" Style="{StaticResource ButtonStyle}">
                                <StackPanel Orientation="Horizontal" >
                                    <Image Source="/resources/image/close04.png" Stretch="Fill" Style="{StaticResource ButtonImageStyle}"></Image>
                                    <Label Content="查询" HorizontalAlignment="Center" Style="{StaticResource ButtonLabelStyle}"></Label>
                                </StackPanel>
                            </Button>

                            <Button   Name="btnAdd"  Click="btnAdd_Click" Style="{StaticResource ButtonStyle}" >
                                <StackPanel Orientation="Horizontal" >
                                    <Image Source="/resources/image/close08.png" Stretch="Fill" Style="{StaticResource ButtonImageStyle}"></Image>
                                    <Label Content="添加" HorizontalAlignment="Center" Style="{StaticResource ButtonLabelStyle}"></Label>
                                </StackPanel>
                            </Button>
                            

                        </StackPanel>
                        
                    </Grid>
                </GroupBox>


                <GroupBox Header="一览" Height="330" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center"  Margin="5,0,5,0" Name="groupBox2" VerticalAlignment="Top" Width="980">
                    <StackPanel Orientation="Vertical">
                        <DataGrid x:Name="TreeGrid" Style="{StaticResource DataGridStyle}" Margin="5,10,5,0" AutoGenerateColumns="False" IsReadOnly="True">
                          
                            <DataGrid.Columns>
                                <DataGridTemplateColumn Header="编号">
                                    <DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Border Width="{Binding MarginLeft}"/>
                                                <ToggleButton x:Name="ExpanderButton" IsChecked="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  Visibility="{Binding IsVisible}">
                                                    <ToggleButton.Template>
                                                        <ControlTemplate TargetType="ToggleButton">
                                                            <Grid x:Name="Root" Background="Transparent">
                                                                <VisualStateManager.VisualStateGroups>
                                                                    <VisualStateGroup x:Name="CommonStates">
                                                                        <VisualState x:Name="Normal"/>
                                                                        <VisualState x:Name="MouseOver">
                                                                            <Storyboard>
                                                                                <ColorAnimation Duration="0" To="#FF1BBBFA" Storyboard.TargetProperty="(Path.Stroke).Color" Storyboard.TargetName="UncheckedVisual"/>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                        <VisualState x:Name="Disabled">
                                                                            <Storyboard>
                                                                                <DoubleAnimation Duration="0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root"/>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                    </VisualStateGroup>
                                                                    <VisualStateGroup x:Name="CheckStates">
                                                                        <VisualState x:Name="Unchecked"/>
                                                                        <VisualState x:Name="Checked">
                                                                            <Storyboard>
                                                                                <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="UncheckedVisual"/>
                                                                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedVisual"/>
                                                                            </Storyboard>
                                                                        </VisualState>
                                                                    </VisualStateGroup>
                                                                </VisualStateManager.VisualStateGroups>
                                                                <Grid HorizontalAlignment="Right" Margin="2 2 5 2">
                                                                    <Path x:Name="UncheckedVisual" Data="M 0,0 L 0,9 L 5,4.5 Z" Fill="#FFFFFFFF" HorizontalAlignment="Right" Height="9" Stroke="#FF989898" StrokeThickness="1" StrokeLineJoin="Miter" VerticalAlignment="Center" Width="6"/>
                                                                    <Path x:Name="CheckedVisual" Data="M 6,0 L 6,6 L 0,6 Z" Fill="#FF262626" HorizontalAlignment="Center" Height="6" Opacity="0" StrokeLineJoin="Miter" VerticalAlignment="Center" Width="6"/>
                                                                </Grid>
                                                            </Grid>
                                                        </ControlTemplate>
                                                    </ToggleButton.Template>
                                                </ToggleButton>
                                                <TextBlock Text="{Binding paraid}"/>
                                            </StackPanel>
                                        </DataTemplate>
                                    </DataGridTemplateColumn.CellTemplate>
                                </DataGridTemplateColumn>
                                <DataGridTextColumn Header="名称" Binding="{Binding paraname}"/>
                                <DataGridTextColumn Header="值" Binding="{Binding paravalue}"/>
                                <DataGridTextColumn Header="结果值" Binding="{Binding resultvalue}"/>
                                <DataGridTextColumn Header="影响因素" Binding="{Binding property}"/>
                                <DataGridTextColumn Header="备注" Binding="{Binding comment}"/>
                                <DataGridTextColumn Header="所属项目" Binding="{Binding projectname}"/>
                                <DataGridTextColumn Visibility="Hidden" Binding="{Binding paraid}"></DataGridTextColumn>

                                <DataGridTemplateColumn Header="操作">
                                    <DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Button  Style="{StaticResource DataRowButtonStyle}" Name="btnEdit" Click="btnEdit_Click"  >

                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="Resources\image\fk_bj.png"></Image>

                                                    </StackPanel>
                                                </Button>
                                                <Button  Style="{StaticResource DataRowButtonStyle}" Name="btnDel" Click="btnDel_Click">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Source="Resources\image\fk_cs.png"></Image>

                                                    </StackPanel>
                                                </Button>
                                            </StackPanel>

                                        </DataTemplate>
                                    </DataGridTemplateColumn.CellTemplate>
                                </DataGridTemplateColumn>
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>
                </GroupBox>

            </Grid>
        </Border>

        
    </Grid>
</UserControl>
